<template>
  <intellect-risk :riskQuery="riskQuery" @riskDetail="riskDetail" @riskLegalDetail="riskLegalDetail" @riskRuleList="riskRuleList" />
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      riskQuery: { riskId: 1 },
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    /**
     * params
     */
    riskRuleList(params, success, failure) {
      return new Promise((resolve, reject) => {
        const res = {
          code: 0,
          msg: null,
          data: {
            records: [
              {
                searchValue: null,
                createBy: '',
                createTime: '2021-12-15 15:32:18',
                updateBy: '',
                updateTime: null,
                remark: null,
                dataScope: null,
                params: {},
                delFlag: '0',
                sortValue: null,
                sortOrderDescFlag: false,
                id: 64603,
                baseId: 1012,
                qccId: '1d3a3e6423628756927abc9fd3e21170',
                defendantList: '清远市港龙陶瓷有限公司',
                prosecutorList: '张**',
                executeGov: null,
                lianDate: '1410715640579',
                caseReason: '民间借贷纠纷',
                caseNo: '（2021）粤1803民初1028号',
                court: null,
                content: null,
                category: null,
                uploadDate: null,
                publishedDate: null,
                publishedPage: null,
                party: null,
                caseName: null,
                casDescNo: null,
                caseType: null,
                submitDate: null,
                updateDate: null,
                prosecutorFlag: null,
                defendantFlag: null,
                courtYear: null,
                courtMonth: null,
                caseRole: null,
                courtLevel: null,
                caseReasonType: null,
                amount: null,
                eventType: '1',
                returnId: '5f95d5b5c17acdccdc587fb72da3777a',
                businessName: null,
              },
            ],
            total: 1,
            size: 5,
            current: 1,
            orders: [],
            optimizeCountSql: true,
            searchCount: true,
            countId: null,
            maxLimit: null,
            pages: 1,
          },
        };
        setTimeout(() => {
          if (res.data) {
            resolve(res.data);
          } else {
            reject(res.msg);
          }
        }, 300);
      })
        .then(success)
        .catch(failure);
    },
    /**
     * params
     */
    riskDetail(params, success, failure) {
      return new Promise((resolve, reject) => {
        const res = {
          code: 0,
          msg: null,
          data: {
            riskId: 1513,
            riskBusinessBaseInfo: {
              createTime: null,
              baseId: 1012,
              businessId: null,
              qccId: '1d3a3e6423628756927abc9fd3e21170',
              businessName: '清远市港龙陶瓷有限公司',
              businessAlias: null,
              historyNames: '[]',
              englishName: null,
              regStatus: '吊销企业',
              regCapital: '800万元人民币',
              regNumber: '441800400009430',
              staffNumRange: '100-199人',
              industry: null,
              bondNum: null,
              bondName: null,
              legalPersonType: 0,
              legalPersonName: '王清河',
              revokeDate: null,
              cancelDate: null,
              sourceFlag: null,
              revokeReason: null,
              creditCode: '9144180055366945XY',
              bondType: null,
              usedBondName: null,
              fromTime: '1276099200000',
              approvedTime: null,
              socialStaffNum: 110,
              companyOrgType: '有限责任公司（港澳台自然人独资）',
              correctCompanyId: null,
              orgNumber: '55366945-X',
              cancelReason: null,
              toTime: '2854022400000',
              actualCapital: '500万元人民币',
              estiblishTime: '1276099200000',
              regInstitute: '清远市市场监督管理局',
              businessScope: '生产销售陶瓷制品。(依法须经批准的项目，经相关部门批准后方可开展经营活动)',
              taxNumber: null,
              regLocation: '清远市清新区禾云镇云龙工业园C-6号',
              regCapitalCurrency: null,
              actualCapitalCurrency: null,
              tags: null,
              percentileScore: null,
              isMicroEnterprise: null,
              provinceShortName: 'GD',
              imageUrl: 'https://image.qcc.com/auto/1d3a3e6423628756927abc9fd3e21170.jpg?x-oss-process=style/logo_120',
              companyId: null,
              updateTimes: '1639553530047',
            },
            ruleResults: [
              {
                label: '失信信息',
                egLabel: 'shixinRule',
                statusCode: 'F',
                riskLevel: '2',
                total: 3,
                sonResults: [{ label: '该公司 是最高人名法院所公示的失信公司', egLabel: 'shixinNodes', statusCode: 'F', riskLevel: '2', total: 3, keyIds: null, datas: null }],
              },
              {
                label: '历史失信信息',
                egLabel: 'historyShixinRule',
                statusCode: 'F',
                riskLevel: '2',
                total: 10,
                sonResults: [{ label: '该公司 曾被最高人民法院所公示的失信公司', egLabel: 'historyShixinNodes', statusCode: 'F', riskLevel: '2', total: 10, keyIds: null, datas: null }],
              },
              {
                label: '被执行人',
                egLabel: 'zhixingRule',
                statusCode: 'F',
                riskLevel: '1',
                total: 1,
                sonResults: [
                  { label: '该公司 因未按时履行法律义务而被法院强制执行', egLabel: 'zhixingNodesOne', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 因未按时履行法律义务而被法院强制执行', egLabel: 'zhixingNodesTwo', statusCode: 'F', riskLevel: '1', total: 1, keyIds: null, datas: null },
                  { label: '该公司 因未按时履行法律义务而被法院强制执行', egLabel: 'zhixingNodesThree', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 因未按时履行法律义务而被法院强制执行', egLabel: 'zhixingNodesFour', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                ],
              },
              {
                label: '历史被执行人',
                egLabel: 'historyZhixingRule',
                statusCode: 'F',
                riskLevel: '2',
                total: 27,
                sonResults: [
                  { label: '该公司 曾因未按时履行法律义务而被法院强制执行', egLabel: 'historyZhixingNodes', statusCode: 'F', riskLevel: '2', total: 27, keyIds: null, datas: null },
                  { label: '该公司 曾因未按时履行法律义务而被法院强制执行', egLabel: 'historyZhixingNodesTwo', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 曾因未按时履行法律义务而被法院强制执行', egLabel: 'historyZhixingNodesThree', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                ],
              },
              {
                label: '法律诉讼(包含开庭公告、判决文书、法院公告)',
                egLabel: 'legalActionRule',
                statusCode: 'F',
                riskLevel: '2',
                total: 3,
                sonResults: [
                  { label: '该公司 有票据纠纷 开庭公告信息', egLabel: 'billDisputeNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 有劳动报酬纠纷 开庭公告信息', egLabel: 'labourDisputeNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 有金融借贷纠纷 开庭公告信息', egLabel: 'financialDisputeNodes', statusCode: 'F', riskLevel: '2', total: 1, keyIds: null, datas: null },
                  { label: '该公司 曾因票据纠纷而被他人或公司起诉', egLabel: 'billDisputeJudgmentNodes', statusCode: 'F', riskLevel: '2', total: 1, keyIds: null, datas: null },
                  { label: '该公司 曾因劳动报酬纠纷而被他人或公司起诉', egLabel: 'labourDisputeJudgmentNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 曾因金融借贷纠纷而被他人或公司起诉', egLabel: 'financialDisputeJudgmentNodes', statusCode: 'F', riskLevel: '2', total: 1, keyIds: null, datas: null },
                  { label: '该公司 有票据纠纷 法院公告信息', egLabel: 'billDisputeLegalActionNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 有劳动报酬纠纷 法院公告信息', egLabel: 'labourDisputelLgalActionNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                  { label: '该公司 有金融借贷纠纷 法院公告信息', egLabel: 'financialDisputeLegalActionNodes', statusCode: 'S', riskLevel: '2', total: 0, keyIds: null, datas: null },
                ],
              },
              {
                label: '新闻舆情',
                egLabel: 'companyNewsRule',
                statusCode: 'F',
                riskLevel: '1',
                total: 2,
                sonResults: [{ label: '该公司 有负面新闻信息', egLabel: 'companyNewsNodes', statusCode: 'F', riskLevel: '1', total: 2, keyIds: null, datas: null }],
              },
              {
                label: '限制消费令',
                egLabel: 'personalLimitRule',
                statusCode: 'F',
                riskLevel: '2',
                total: 41,
                sonResults: [{ label: '该公司 被法院列为限制高消费企业', egLabel: 'personalLimitNodes', statusCode: 'F', riskLevel: '2', total: 41, keyIds: null, datas: null }],
              },
            ],
            paymentRecordShow: null,
            total: 87,
            riskLevel: '2',
          },
        };
        setTimeout(() => {
          if (res.data) {
            resolve(res);
          } else {
            reject(res.msg);
          }
        });
      })
        .then(success)
        .catch(failure);
    },
    /**
     * params
     */
    riskLegalDetail(params, success, failure) {
      return new Promise((resolve, reject) => {
        const res = {
          code: 0,
          msg: null,
          data: {
            Schedule_Time: '',
            Undertake_Department: '',
            Chief_Judge: '',
            Defendant: { KeyNo: '1d3a3e6423628756927abc9fd3e21170', Name: '清远市港龙陶瓷有限公司' },
            Execute_Gov: '广东省清远市清新区人民法院',
            Open_Time: '2021-08-13',
            Province: '广东',
            Case_Reason: '民间借贷纠纷',
            Execute_Unite: '第七审判庭/中',
            CaseNo: '（2021）粤1803民初1028号',
            Content:
              '<a href="https://www.qichacha.com/firm_g16e1e57bf28f9f2892b24216cecb590.html" target="_blank">清远市清新区人民法院</a>定于2021-08-13 15:00 在<a href="https://www.qichacha.com/firm_g16e1e57bf28f9f2892b24216cecb590.html" target="_blank">清远市清新区人民法院</a>第七审判庭/中公开开庭审理[原告]张**,[被告]<a href="https://www.qichacha.com/firm_1d3a3e6423628756927abc9fd3e21170.html" target="_blank">清远市港龙陶瓷有限公司</a>,[第三人]洪**民间借贷纠纷一案',
            Prosecutor: { KeyNo: '', Name: '张**' },
            Case_No: '（2021）粤1803民初1028号',
          },
        };
        setTimeout(() => {
          if (res.data) {
            resolve(res);
          } else {
            reject(res.msg);
          }
        });
      })
        .then(success)
        .catch(failure);
    },
  },
};
</script>

<style scoped lang="scss"></style>
